
**This is the do file to run the regressions on camera usage. The dataset merged the survey with camera usage. 
clear all

use "regressions_camera_usage.dta"
set more off

******
****generate indexes of community agression and use of force. Original variables were recoded to dummies (0-1)
	
	
alpha 	res_aggress_cursd res_aggress_wateryd res_aggress_urined 				///
			res_aggress_stoned res_aggress_threatd res_aggress_attackd,		 	///
			gen(index_comm_agression)
	
alpha force_firearmd force_ocurr_deathd force_armed_conflictd, gen(index_force_dos) 

***** Below are the regression models of h_min_dur_adjusted (this is the time offices turned on the cameras adjusted for the total time they were assigned a camera). 
******Excluding outliers of camera usage larger than >4000. 
******Duplicates is a dummy corrresponding to officers who were interviewd in more than one wave. 

**********

set more off
regress h_min_dur_adj i.age_cat i.race_cat i.education i.units_study  index_comm_agression  i.duplicates_dum i.base if h_min_dur <4000 & (base==2 | base==3), cluster(unit_name_num )
outreg2 using "uso_camara_survey.tex", dec(3) ctitle(Usage) replace 
regress h_min_dur_adj i.age_cat i.race_cat  i.education i.units_study   index_force_dos i.duplicates_dum i.base if h_min_dur <4000 & (base==2 | base==3), cluster(unit_name_num )
outreg2 using "uso_camara_survey.tex", dec(3) ctitle(Usage) append
regress h_min_dur_adj i.age_cat i.race_cat  i.education i.units_study  cam_sup_fq i.base i.duplicates_dum i.base if h_min_dur <4000 & (base==2 | base==3), cluster(unit_name_num )
outreg2 using "uso_camara_survey.tex", dec(3) ctitle(Usage) append
regress h_min_dur_adj i.age_cat i.race_cat  i.education i.units_study   force_wounded_d i.duplicates_dum  i.base if h_min_dur <4000 & (base==2 | base==3), cluster(unit_name_num )
outreg2 using "uso_camara_survey.tex", dec(3) ctitle(Usage) append
regress h_min_dur_adj i.age_cat i.race_cat  i.education i.units_study   force_wound_someone_d i.duplicates_dum i.base if h_min_dur <4000 & (base==2 | base==3), cluster(unit_name_num )
outreg2 using "uso_camara_survey.tex", dec(3) ctitle(Usage) append
regress h_min_dur_adj i.age_cat i.race_cat  i.education i.units_study index_comm_agression index_force_dos  cam_sup_fq  force_wounded_d force_wound_someone_d i.duplicates_dum i.base  if h_min_dur <4000 & (base==2 | base==3), cluster(unit_name_num )
outreg2 using "uso_camara_survey.tex", dec(3) ctitle(Usage) append

